class Solution(object):
    def missingNumber(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        s = (1 + len(nums)) * len(nums) / 2
        for a in nums:
            s -= a
        return s

if __name__ == '__main__':
    so = Solution()
    print so.missingNumber([1,2])